﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TRINHTUNGLAM.OOP.EX3
{
    class MODELS
    {
        public double ChuyendoiModels(Entity objEntity)
        {
            double kq= 0;
            if(objEntity.thang ==2)
            {
                if(objEntity.nam % 4==0 && objEntity.nam % 100 ==0 )
                {
                    kq = 29;
                }
                else
                {
                    kq= 28;
                }
            }
            else if(objEntity.thang ==1 || objEntity.thang ==3 || objEntity.thang ==5 || objEntity.thang ==7 ||
                objEntity.thang ==9 || objEntity.thang ==11 )
                {
                    kq = 31;
                }
            else kq = 30;

            return kq;
        }
    }
}
